home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Printer Drivers… / ImageWriter--custom dialogs / CommonDefines.h < prev    next >
Encoding:
Text File  |  1996-03-20  |  5.2 KB  |  163 lines  |  [TEXT/MPS ]

  1. /*
  2.     copyright © 1992-1994 Apple Computer Inc.  All rights reserved.
  3.     
  4.     CommonDefines.h
  5.     This file defines values used by more than one .r or .h file.
  6.     
  7.     Modification history
  8.  
  9.     12/22/93        dmh                Added custom dialog code.
  10.     12/20/93        dmh                Sync'd with the shipping 1.0b3 GX driver.
  11.     7/23/92            TED                New file today
  12.     
  13. */
  14.  
  15. // driver info
  16. #define DriverName        "ImageWriter"
  17. #define DriverType         'pdvr'
  18. #define DriverCreator     'IWcd'
  19.  
  20. // code segment info
  21. #define DriverSegType    DriverType
  22. #define NewSegID        0
  23. #define OldSegID        1
  24.  
  25. // resource IDs for panel resources
  26.  
  27. #define r_FlipPanel                5000
  28. #define r_FlipPanelIcon            5000
  29. #define r_FlipPanel2            5050
  30. #define r_FlipPanelIcon2        5050
  31.  
  32. // resource IDs for STR#s
  33. #define    kFormatModeFontsID                gxPrintingDriverBaseID        // List of "native" mode fonts supported
  34. #define    kFormatModeStylesID                (gxPrintingDriverBaseID + 1)    //    List of "well" known styles that are supported
  35. #define kOldQualityID                    (gxPrintingDriverBaseID + 2)
  36. #define kNewQualityID                    (gxPrintingDriverBaseID + 3)
  37. #define    kBoldStyle                        1                            //    Index into kFormatModeStylesID 'STR#' of the bold style string
  38. #define    kUnderlineStyle                    2                            //    Index into kFormatModeStylesID 'STR#' of the underline style string
  39. #define kBestString                        1
  40. #define kRoughString                    2
  41.  
  42.  
  43. // Various resource defines.
  44.  
  45. //------------- job dialog -------------
  46.  
  47. #define d_QualPopUp               5    // DITL item of the quality pop up menu in
  48.                                     // Job dialog.
  49. #define r_QualPopUpCtl        150        // Quality pop up menu control res. ID.
  50.  
  51. #define r_QualPopUpMenu         160    // ID of the quality pop up menu.
  52. #define i_DraftItem               3    // The "Draft" item in the popup menu.
  53.  
  54.  
  55. //------------- style dialog ------------
  56.  
  57. #define    r_OptionsButton          21    // Button in Style dialog that invokes
  58.                                     // the options dialog.
  59.  
  60.  
  61. //------------- options dialog ------------
  62.  
  63.  
  64. #define r_OptionsDialog        1918    // ID of the options DLOG/DITL.
  65.  
  66. #define d_FlipPict               4    // DITL item of userItem (PICT) in both
  67.                                     // options dialog, and format panel.
  68. #define d_LineItem               5    // DITL item of userItem (line).
  69. #define d_HFlip                   6    // DITL item of "flip horizontal" checkbox.
  70. #define d_VFlip                   7    // DITL item of "flip vertical" checkbox.
  71.  
  72. //------------- options panel ------------
  73.  
  74. #define d_pHFlip               2    // DITL item of "flip horizontal" checkbox.
  75. #define d_pVFlip               3    // DITL item of "flip vertical" checkbox.
  76.  
  77.                                     // IDs of PICTs drawn in the options dialog.
  78.                                     
  79. #define p_Normal             128    // Normal (unflipped).
  80. #define p_HFlip                 129    // Flipped horizontal.
  81. #define p_VFlip                 130    // Flipped vertical.
  82. #define p_HVFlip             131    // Flipped horizontal and vertical.
  83.  
  84.  
  85. // status information
  86. #define kDriverStatus        gxPrintingDriverBaseID    // stat resource ID
  87. #define kSendingData        1                        // item number for sending data
  88. #define kCheckOnline        2                        // item number for printer offline
  89.  
  90. // options, placed into the job collection
  91. #define kSuperRes            0x1                // highest res possible (160X144, 80X72)
  92.  
  93.  
  94. // do the following only if we aren't running in Rez
  95. #ifndef REZ
  96.  
  97. #define kNoPackagingOptions    0
  98. #define kDoSmallLineFeeds    0x1
  99.  
  100. typedef struct FlipCollection
  101. {
  102.     char    flipHorizontal;
  103.     char    flipVertical;
  104. } FlipCollection, *FlipCollectionPtr, **FlipCollectionHdl;
  105.  
  106.  
  107. // Struct to hold flipped picts when options dialog is up.
  108.  
  109. typedef struct FourPicts {
  110.     char        curFlipping;    // Current flip settings.
  111.     PicHandle    pict[4];        // PICTs representing the 4 different flip settings.
  112. } FourPicts;
  113.  
  114.  
  115. // our new API's global data structure
  116. typedef struct
  117.     {
  118.     long    leftMargin;            // margin at left edge of page
  119.     long    lineFeeds;            // accumulated lines feeds
  120.     long    packagingOptions;    // controls packaging and escape generation
  121.     ResType    commType;            // type of communications
  122.     Handle     draftTable;            // table for driving draft output, nil when not loaded
  123.     Boolean    isImageWriterII;    // is this an ImageWriter II?
  124.     } SpecGlobals, *SpecGlobalsPtr, **SpecGlobalsHdl;
  125.  
  126.  
  127. // Our global data structure for data we need to store and
  128. // retrieve from our Job & Style dialog's item/hit/initProcs.
  129. // Note: originalItemProc is used by both the style and the job
  130. // dialogs, but optionsDialog and flippedPicts are only used by
  131. // the style dialog.
  132.  
  133. typedef struct DialogGlobals {
  134.     Boolean        inStyleDialog;        // true = Style dialog, false = Job dialog.
  135.     void        *originalItemProc;    // the dialog's original itemProc.
  136.     DialogPtr    optionsDialog;        // pointer to our options dialog.
  137.     FourPicts    *flippedPicts;        // pointer to our Style dialog's flip picts.
  138. } DialogGlobals, *DialogGlobalsPtr, **DialogGlobalsHdl;
  139.  
  140.  
  141. // Prototypes:
  142.  
  143. extern OSErr StoreFmtCollectionItem(void *collectItem, long collectSize,
  144.                                     OSType collectType, short collectID,
  145.                                     gxFormat whichFormat);
  146.  
  147. extern OSErr GetFmtCollectionItem(void *collectItem, long *collectSize,
  148.                                   OSType collectType, short collectID,
  149.                                   gxFormat whichFormat);
  150.  
  151. extern char GetCurFlip(DialogPtr theDialog, short hFlipBox, short vFlipBox);
  152. extern void SetFormatFlipping(char flipSetting, gxFormat whichFormat);
  153. extern OSErr HandlePanelUpdate(DialogPtr theDialog, gxPanelInfoRecord *panelInfo);
  154. extern void SetFormatFlipping(char flipSetting, gxFormat whichFormat);
  155.  
  156. #undef r_FlipPanel2
  157. #undef r_FlipPanelIcon2
  158.  
  159. #define r_FlipPanel2            5000
  160. #define r_FlipPanelIcon2        5000
  161.  
  162. #endif
  163.